
#pragma once

#include "EventType.h"
#include "IEventData.h"


class Event
{

public:

	typedef boost::shared_ptr<Event> Ptr;

private:

	EventType mType;
	IEventData::Ptr mEventData;

public:

	explicit Event( char const * const eventTypeIdentStr, 
		IEventData::Ptr eventData = IEventData::Ptr( (IEventData*)0) )
		: mType( eventTypeIdentStr ), mEventData( eventData )
	{}

	Event( Event const & ev )
		: mType( ev.mType ), mEventData( ev.mEventData )
	{}

	EventType const & GetType() const
	{
		return mType;
	}

	IEventData::Ptr GetData() const
	{
		return mEventData;
	}

	template<typename T>
	T * GetDataPtr() const
	{
		return reinterpret_cast<T *>( mEventData.get() );
	}

	virtual ~Event()
	{

	}	

};